<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<!-- 头部导航栏 -->
<jsp:include page="../header.jsp"></jsp:include>
<title>===标题===</title>
<script src="<%=request.getContextPath()%>/assets/js/dz-plugin.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	//提交表单验证
	$("#query_form").submit(function () {
  		return false;
	});
	
	//分页事件监听
	$("#dz_paging").openPage();
});

//删除数据
function deleteData(id) {
	if(confirm("您确定删除此数据吗？")) {
		window.location.href = "<%=request.getContextPath()%>/security/group/delete.do?groupId=" + id;
	}
}
</script>
</head>
<body>
	<div class="container dz-main">
		<!-- 操作信息提示===begin=== -->
		<c:if test="${success != null}">
			<div class="alert alert-success dz-alert">
				<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
				<strong>成功：</strong>${success}
			</div>
		</c:if>
		<c:if test="${error != null}">
			<div class="alert alert-danger dz-alert">
				<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
				<strong>失败：</strong>${error}
			</div>
		</c:if>
		<!-- 操作信息提示===end=== -->
		<!--标题和导航按钮组===begin===-->
		<div class="dz-head">
			<div class="dz-title">管理</div>
		</div>
		<!--标题和导航按钮组===end===-->
		<!--数据查询表单===begin===-->
		<div class="dz-query">
			<form id="query_form" action="<%=request.getContextPath()%>/security/group/index.do" method="post">
				<table>
					<col width="120px;"/>
					<col width="160px;"/>
					<col width="120px;"/>
					<col width="160px;"/>
					<col width="120px;"/>
					<col width="160px;"/>
					<col width="120px;"/>
					<col width="160px;"/>
					<tr>
						<td><label for="q_key_1">测试1：</label></td>
						<td><input type="text" id="q_key_1" class="form-control input-sm" name="q_key" value=""/></td>
						<td><label for="q_key_1">测试2：</label></td>
						<td>
							<select class="form-control input-sm" name="">
								<option>===请选择===</option>
								<option value="1">1</option>
								<option value="1">2</option>
							</select>
						</td>
					</tr>
				</table>
				<input id="paging_page" type="hidden" name="page" value="${page.page}"/>
				<input id="paging_count" type="hidden" name="count" value="${page.count}"/>
				<div class="dz-qbtns">
					<button type="button" class="btn btn-default btn-sm" onclick="reset();">重置</button>
					<button type="submit" class="btn btn-default btn-sm">查询</button>
				</div>
			</form>
		</div>
		<!--数据查询表单===end===-->
		<!--操作按钮组===begin===-->
		<div class="btn-group btng-op">
			<a class="btn btn-info btn-sm" href="<%=request.getContextPath()%>/security/group/build.do">新建</a>
		</div>
		<!--操作按钮组===end===-->
		<div>
			<table class="table table-bordered table-hover dz-table">
				<col width="37px;"/>
				<thead>
					<tr>
						<th></th>
						<th>角色组名称</th>
						<th>角色组标识</th>
						<th>描述信息</th>
						<th></th>
						<th></th>
						<th></th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody id="dz_tbody">
					<c:forEach var="o" items="${list}" varStatus="status">
					<tr>
						<td style="text-align:center;">${status.index+1}</td>
						<td>${o.groupName}</td>
						<td>${o.groupSign}</td>
						<td>${o.description}</td>
						<td>${o.createrId}</td>
						<td>${o.createrName}</td>
						<td>${o.createDate}</td>
						<td style="overflow:visible; padding:3px 0 0 10px;">
							<div class="btn-group">
								<button class="btn btn-info btn-sm" style="min-width:75px;">操作</button>
								<button class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
								<ul class="dropdown-menu dz-menu-op">
									<li><a href="<%=request.getContextPath()%>/security/group/look.do?groupId=${o.groupId}">查看</a></li>
									<li><a href="<%=request.getContextPath()%>/security/group/build.do?groupId=${o.groupId}">修改</a></li>
									<li><a onclick="deleteData('${o.groupId}');">删除</a></li>
								</ul>
							</div>
						</td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<div id="dz_paging">
			<ul class="pagination dz-nav">
				<li><a value="${page.last}">«</a></li>
				<c:forEach var="x" begin="${page.start}" end="${page.over}">
					<li <c:if test="${x==page.page}">class="active"</c:if>><a value="${x}">${x}</a></li>
				</c:forEach>
				<li><a value="${page.next}">»</a></li>
				<li>
					<div class="dz-paging">每页
						<select>
							<option value="10" <c:if test="${page.count == 10}">selected</c:if>>10</option>
							<option value="20" <c:if test="${page.count == 20}">selected</c:if>>20</option>
							<option value="50" <c:if test="${page.count == 50}">selected</c:if>>50</option>
						</select>&nbsp;条
					</div>
				</li>
				<li>
					<input type="text"/><button value="${page.pageSum}">GO</button>
				</li>
				<li>
					<span style="margin-left:10px;">${page.total}条数据/共${page.pageSum}页</span>
				</li>
			</ul>
		</div>
	</div>
</body>
</html>